const yaml = require('js-yaml');
const fs   = require('fs');
const merge = require('deepmerge')

// Get document, or throw exception on error
try {
    const tplConf = yaml.safeLoad(fs.readFileSync('./docker-compose-tpl.yml', 'utf8'));
    const appConf = yaml.safeLoad(fs.readFileSync('./app.yml', 'utf8'));
    //console.log(doc);

    fs.writeFileSync('docker-compose.yml' , yaml.dump(merge(tplConf , appConf)))
} catch (e) {
    console.log(e);
}

